<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@ include file="/WEB-INF/view/system/common/head.jsp"%>
<script type="text/javascript" src="asserts/plugins/easyui/plugins/jquery-easyui-datagridview/datagrid-detailview.js"></script>
<body>
  <div id="datagrid"></div>

</body>
<script type="text/javascript" charset="UTF-8">
	var dataGrid = commonDataGrid({
		url:'/pi-admin/diagnosis/record/list/query',
		columns:[[
			{field:'diagnosisId',title:'流水号',align:'center'}, 
			{field:'diagnosisDate',title:'诊断日期',align:'center'},
			{field:'userName',title:'测试人名称',align:'center'},
			{field:'userAge',title:'用户年龄',align:'center'},
			{field:'userMobile',title:'用户手机号',align:'center'},
			{field:'diagnosisLevel',title:'结果',align:'center'}, 
			{field:'delayPeriod',title:'响应延迟',align:'center'}, 
			{field:'reactPeriod',title:'反应时间',align:'center'}, 
			{field:'interference',title:'正确数干扰量',align:'center'}, 
			{field:'inviterName',title:'邀请人名称',align:'center'},
		]],
    toolbar: [
        { text: '导出数据', iconCls: 'icon-excel', handler: exportExcel },
    ],
		title:'测试记录',
		pagination:true,
		pageSize:50,
		pageList:[50,100,150,200],
		view: detailview,
		detailFormatter: function(rowIndex, rowData){ 
		  return '<table class="detailGrid"></table>'; 
		},
		onExpandRow: function(index,row){
		    var detailGrid = $(this).datagrid('getRowDetail',index).find('table.detailGrid');//找到该父类Formatter的子类表格
		    detailGrid.datagrid({
		    	  data: row.taskList,
		        fitColumns:true,
		        singleSelect:true,
		        rownumbers:false,
		        height:'auto',
		        columns:[[
		            {field:'taskName',title:'任务名称'}, 
		            {field:'errorCount',title:'错误数'},
                {field:'correctCount',title:'正确数'}, 
                {field:'misCount',title:'错过数'},
                {field:'originData',title:'原始数据'}, 
		        ]],
		        onResize:function(){
		        	dataGrid.datagrid('fixDetailRowHeight',index);
		        },
		        onLoadSuccess:function(){
		        	dataGrid.datagrid('fixDetailRowHeight',index);
		        }
		    });
		    dataGrid.datagrid('fixDetailRowHeight',index);
		}
	});
	
	function exportExcel(){
		formPost({
			url:'/pi-admin/diagnosis/record/list/export/full'
		});
		commonShow('导出成功');
	}
</script>
</html>